package com.ruoyi.algorithm.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.algorithm.annotation.TableStructAnno;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @TableName image
 */
@TableName(value ="image")
@Data
@ApiModel
@TableStructAnno("image")
public class Image implements Serializable {
    /**
     * 主键id
     */
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    @TableStructAnno("id")
    private Long id;

    /**
     * 镜像名称
     */
    @ApiModelProperty("镜像名称")
    @TableField(value = "image_name")
    @TableStructAnno("镜像名称")
    private String imageName;

    /**
     * 系统架构
     */
    @TableField(value = "system_frame")
    @TableStructAnno("系统架构")
    private String systemFrame;

    /**
     * 作者
     */
    @ApiModelProperty("作者")
    @TableField(value = "author")
    @TableStructAnno("作者")
    private String author;

    /**
     * 系统
     */
    @TableField(value = "system")
    @TableStructAnno("系统")
    private String system;

    /**
     * 厂商ID
     */
    @ApiModelProperty("厂商ID")
    @TableField(value = "manufacturer_id")
    @TableStructAnno("厂商ID")
    private Integer manufacturerId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @TableStructAnno("创建时间")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    @TableStructAnno("更新时间")
    private Date updateTime;

    /**
     * 创建人
     */
    @TableField(value = "create_user")
    @TableStructAnno("创建人")
    private Long createUser;

    /**
     * 更新人
     */
    @TableField(value = "update_user")
    @TableStructAnno("更新人")
    private String updateUser;

    /**
     * 删除标志（0未删除；1已删除）
     */
    @TableField(value = "del_flag")
    @TableStructAnno("删除标志")
    private String delFlag;

    /**
     * 最后版本号
     */
    @TableField(value = "last_version")
    private String lastVersion;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Image other = (Image) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getImageName() == null ? other.getImageName() == null : this.getImageName().equals(other.getImageName()))
            && (this.getSystemFrame() == null ? other.getSystemFrame() == null : this.getSystemFrame().equals(other.getSystemFrame()))
            && (this.getAuthor() == null ? other.getAuthor() == null : this.getAuthor().equals(other.getAuthor()))
            && (this.getSystem() == null ? other.getSystem() == null : this.getSystem().equals(other.getSystem()))
            && (this.getManufacturerId() == null ? other.getManufacturerId() == null : this.getManufacturerId().equals(other.getManufacturerId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
            && (this.getUpdateUser() == null ? other.getUpdateUser() == null : this.getUpdateUser().equals(other.getUpdateUser()))
            && (this.getDelFlag() == null ? other.getDelFlag() == null : this.getDelFlag().equals(other.getDelFlag()))
            && (this.getLastVersion() == null ? other.getLastVersion() == null : this.getLastVersion().equals(other.getLastVersion()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getImageName() == null) ? 0 : getImageName().hashCode());
        result = prime * result + ((getSystemFrame() == null) ? 0 : getSystemFrame().hashCode());
        result = prime * result + ((getAuthor() == null) ? 0 : getAuthor().hashCode());
        result = prime * result + ((getSystem() == null) ? 0 : getSystem().hashCode());
        result = prime * result + ((getManufacturerId() == null) ? 0 : getManufacturerId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
        result = prime * result + ((getUpdateUser() == null) ? 0 : getUpdateUser().hashCode());
        result = prime * result + ((getDelFlag() == null) ? 0 : getDelFlag().hashCode());
        result = prime * result + ((getLastVersion() == null) ? 0 : getLastVersion().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", imageName=").append(imageName);
        sb.append(", systemFrame=").append(systemFrame);
        sb.append(", author=").append(author);
        sb.append(", system=").append(system);
        sb.append(", manufacturerId=").append(manufacturerId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", createUser=").append(createUser);
        sb.append(", updateUser=").append(updateUser);
        sb.append(", delFlag=").append(delFlag);
        sb.append(", lastVersion=").append(lastVersion);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
